﻿// Core/Models/Menu.cs
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

[Table("Menus")]
public class Menu
{
    public int Id { get; set; }
    public int? ParentId { get; set; }
    public string Title { get; set; }
    public string Icon { get; set; }
    public string Index { get; set; }
    public string RoutePath { get; set; }
    public string GroupName { get; set; }
    public int Sort { get; set; }
    public bool IsActive { get; set; }

    // 导航属性
    [ForeignKey("ParentId")]
    public virtual Menu Parent { get; set; }
    public virtual ICollection<Menu> Children { get; set; } = new List<Menu>();
}